<% include ../pageHeader %>

<div id="mainWrapper">
    <div id="content" class="content">
        <div id="innerContent">
            <div class="textbox">
                <div class="textbox-title"><h4><%= __('smilies') %></h4></div>
                <div class="textbox-content">
                        <form method="post" action="?in=smilies">
                            <input name="_csrf" type="hidden" value="<%- ctx.csrf %>" />
                    <table border="0" cellpadding="3" cellspacing="2">
                            <tr>
                                <td class="listbox-header"></td>
                                <td class="listbox-header"><%= __('image') %></td>
                                <td class="listbox-header"><%= __('code') %></td>
                                <td class="listbox-header"><%= __('url') %></td>
                            </tr>
                            <% for(var i = 0;i < theCache.smilies.length;i++){
                                    with(theCache.smilies[i]){ %>
                                <tr>
                                    <td><input type="checkbox" name="selected" value="<%= id %>"/><input type="hidden"
                                                                                                         name="id"
                                                                                                         value="<%= id %>"/>
                                    </td>
                                    <td><img src="/public/<%= theCache.settings["smiliesFolder"]+'/'+image %>"/></td>
                                    <td><input type="text" name="code" size="10" maxlength="50"
                                               value="<%= helper.HTMLEncodeLite(code) %>" class="text"/></td>
                                    <td><input type="text" name="image" size="30" maxlength="50"
                                               value="<%= helper.HTMLEncodeLite(image) %>" class="text"/></td>
                                </tr>
                            <% }
                            }
                            %>
                            <tr>
                                <td><%= __('new') %>:<input type="hidden" name="id" value="0"/></td>
                                <td><img src="/public/<%= theCache.settings["imageFolder"]+"/blank.gif" %>" id="imgPreview"/>
                                </td>
                                <td><input type="text" name="code" size="10" maxlength="50" value="" class="text"/></td>
                                <td><input type="text" name="image" size="30" maxlength="50" value="" class="text"
                                           onKeyUp="if(this.value.length>0){imgPreview.src='<%= theCache.settings["smiliesFolder"]+
                                           "/" %>'+this.value;}else{imgPreview.src='<%= theCache.settings["imageFolder"] %>/blank.gif';}"/>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="5">
                                    <br/>
                                    <select name="act">
                                        <option value="update"><%= __('save_change') %></option>
                                        <option value="delete"><%= __('delete_smilies') %></option>
                                    </select>
                                    <input type="submit" name="submit" value=" <%= __('execute') %> " class="button"/>
                                </td>
                            </tr>
                    </table>
                        </form>
                </div>
            </div>
        </div>
    </div>
    <% include adminSidebar %>
    <div class="clear"></div>
</div>

<% include ../pageFooter %>
